/****************************************************************************
*					Inference
*
*	Description:	Common ancestor for classes for running inference in PGM
*
****************************************************************************/

#ifndef _Inference_H
#define _Inference_H

#include <vector>
#include "PGMStruct.h"
#include "DataSet.h"

class Inference {
  private:

  protected:

  public:
	  // Standard constructor - empty one
	Inference(void) {}
      
	  // Standard destructor - empty one
    virtual ~Inference() {}

	  // Sets parameters from environment (defined by config-file)
	virtual int setParameters (Environment &environment) = 0;

      // Runs inference
	virtual int run (float& logZ, PGMStruct& pgmStruct) = 0;

	  // Runs inference
	virtual int run (float& expectedValue, const std::vector < std::pair<unsigned int, unsigned int> >& featureDescr, PGMStruct& pgmStruct) = 0;

	  // Runs inference
	virtual int run (float& expectedValue, const std::vector < std::pair<unsigned int, unsigned int> >& featureDescr, const unsigned int& featureDescrSize, PGMStruct& pgmStruct) = 0;

	  // Runs inference
	virtual int run (float& expectedValue, Feature& feature, std::vector <unsigned int>& varIDs, PGMStruct& pgmStruct) = 0;

	  // Return likelihood of the data in the data set
	virtual float getLogLikelihood (DataSet& dataSet, PGMStruct& pgmStruct) = 0;
	
}; // end of class

#endif // _Inference_H
